package cn.tedu.review;

import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;
import org.w3c.dom.ls.LSOutput;

/*本类用于复习继承*/
public class TestExtends {
    public static void main(String[] args) {
        Animal a = new Animal();
        Cat c = new Cat();
        MM m = new MM();
        DingDing d = new DingDing();
        a.eat();
        c.eat();
        m.eat();
        d.eat();
        m.play();
    }
}

class Animal{
    public void eat(){
        System.out.println("小动物Animal吃啥都行");
    }
}

class Cat extends Animal{
    int a = 10;
    private int c = 100;
}

class MM extends Cat{
    public void play(){
        System.out.println(a);//子类可以使用父类的普通属性
//        System.out.println(b);//
    }

}

class DingDing extends Cat{}